package com.okilo.online.app.tools.shared

/**
 * SharedHelper
 * @Author wwdeng
 * @CreateTime: 2024/11/8 10:59
 * @Annotation：SharedPreferences 数据存取帮助类
 */
object OkiloSharedHp {

    /**
     * 保存数据
     */
    fun sOkiloSharedData(key: String, value: Any){
        OkiloSharedUtils.put(key,value)
    }

    /**
     * 获取String
     */
    fun gOkiloSharedString(key: String): String{
        return OkiloSharedUtils.getString(key)
    }

    /**
     * 获取boolean
     */
    fun gOkiloSharedBoolean(key: String): Boolean{
        return OkiloSharedUtils.getBoolean(key,false)
    }

    /**
     * 获取Int
     */
    fun gOkiloSharedInt(key: String): Int{
        return OkiloSharedUtils.getInt(key,0)
    }


    /**
     * 移除指定内容
     */
    fun dOkiloSharedData(key: String){
        OkiloSharedUtils.remove(key)
    }

    /**
     * 退出登录，移除用户信息
     */
    fun onOkiloAppOut(){
        //移除已登录状态
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_LOGIN)
        //移除用户Token
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_TOKEN)
        //移除用户id
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_USERID)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_MOBILE)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_IS_ADSOURCE)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_PROCESS)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_CUSTOM_DATA)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_CHAT_LAST_TIME)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_UPDATE_VERSION_LAST_TIME)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_DIALOG_ACTIVE_NUM)
        dOkiloSharedData(OkiloSharedKey.SP_OKILO_DIALOG_NORMAL_NUM)
//        dOkiloSharedData(OkiloSharedKey.SP_OKILO_PERMISSIONS_STATUS)

    }
}